Skip to content

feat: youtube chat read path via grpc streamlist#81

Merged
ImpulseB23 merged 5 commits intomainfrom
feat/youtube-read-path
Apr 19, 2026
Merged

feat: youtube chat read path via grpc streamlist#81
ImpulseB23 merged 5 commits intomainfrom
feat/youtube-read-path

Conversation

@ImpulseB23
Copy link
Copy Markdown
Owner

YouTube live chat read path, third and final platform.

  • gRPC StreamList client in Go sidecar connecting to youtube.googleapis.com:443
  • API key (x-goog-api-key) and OAuth Bearer auth support
  • Reconnect with exponential backoff, permanent error detection (NOT_FOUND, PERMISSION_DENIED, FAILED_PRECONDITION)
  • pageToken tracking for resume on reconnect
  • Proto file from Google's official streaming-live-chat docs, generated Go code committed
  • Tag byte system: 0x01 Twitch, 0x03 YouTube (ring buffer payload prefix)
  • Twitch eventsub updated to prepend its tag byte
  • Rust parse_batch() dispatches by tag to platform-specific parsers
  • parse_youtube_message() handles TEXT_MESSAGE_EVENT, maps owner/mod/sponsor flags
  • youtube_connect/youtube_disconnect sidecar commands
  • 133 Rust tests, all Go tests passing

Copilot AI review requested due to automatic review settings April 18, 2026 22:18
@github-actions github-actions bot added rust Rust/Tauri changes go Go sidecar changes docs Documentation size/xl > 1000 lines, needs splitting labels Apr 18, 2026
@github-actions
Copy link
Copy Markdown

This PR has 3561 lines changed. Consider splitting it into smaller PRs for easier review.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 18, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the YouTube live chat “read” pipeline end-to-end (Go sidecar gRPC stream → tagged ringbuf payloads → Rust host dispatch → unified message parsing), completing the third platform’s inbound chat path.

Changes:

  • Introduces a Go sidecar gRPC StreamList client (proto + generated code) that protojson-serializes LiveChatMessage items and prepends the 0x03 platform tag before writing to the ring buffer.
  • Updates Twitch EventSub to prepend the 0x01 platform tag and updates Rust parse_batch() to dispatch parsing by tag.
  • Adds a Rust parse_youtube_message() parser + unit tests; updates platform API docs.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
docs/platform-apis.md Documents YouTube gRPC streamList read path and tagged payload framing.
apps/desktop/src-tauri/src/message.rs Adds parse_youtube_message() + tests for TEXT_MESSAGE_EVENT handling.
apps/desktop/src-tauri/src/host.rs Dispatches parse_batch() by 1-byte platform tag; adds YouTube connect command serialization.
apps/desktop/src-sidecar/proto/stream_list.proto Adds YouTube streamList proto definition.
apps/desktop/src-sidecar/internal/youtube/ytpb/* Commits generated Go protobuf + gRPC stubs for streamList.
apps/desktop/src-sidecar/internal/youtube/client.go Implements the YouTube gRPC streaming client and tagging.
apps/desktop/src-sidecar/internal/youtube/client_test.go Adds tests around receiving/tagging messages from a fake gRPC server.
apps/desktop/src-sidecar/internal/twitch/eventsub.go Prepends Twitch tag byte to outbound ringbuf payloads.
apps/desktop/src-sidecar/internal/twitch/eventsub_test.go Adjusts test to handle tagged Twitch payloads.
apps/desktop/src-sidecar/internal/sidecar/sidecar.go Wires new youtube_connect/youtube_disconnect commands to start/stop the client.
apps/desktop/src-sidecar/internal/control/control.go Defines tag byte constants and extends command fields for YouTube.
apps/desktop/src-sidecar/go.mod / go.sum Adds gRPC/protobuf dependencies and updates sums.

Comment thread apps/desktop/src-sidecar/internal/youtube/client.go
Comment thread apps/desktop/src-sidecar/internal/youtube/client_test.go
Comment thread apps/desktop/src-sidecar/internal/youtube/client_test.go
Comment thread apps/desktop/src-tauri/src/message.rs Outdated
Comment thread apps/desktop/src-tauri/src/message.rs Outdated
Comment thread apps/desktop/src-tauri/src/message.rs Outdated
Comment thread apps/desktop/src-sidecar/internal/sidecar/sidecar.go
Comment thread apps/desktop/src-sidecar/internal/youtube/client.go
- youtube: validate creds upfront, return ErrMissingCredentials

- youtube: fix errcheck on conn.Close and lis.Close

- youtube: rewrite tests with real gRPC fake server

- youtube: clarify DialOpts override semantics

- message: parse_youtube_message returns Ok(None) on empty fields

- message: surface timestamp parse errors instead of silent now()

- message: add tests for empty fields and bad timestamps
@github-actions
Copy link
Copy Markdown

This PR has 3678 lines changed. Consider splitting it into smaller PRs for easier review.

@github-actions
Copy link
Copy Markdown

This PR has 3659 lines changed. Consider splitting it into smaller PRs for easier review.

@github-actions
Copy link
Copy Markdown

This PR has 3660 lines changed. Consider splitting it into smaller PRs for easier review.

@github-actions
Copy link
Copy Markdown

This PR has 3946 lines changed. Consider splitting it into smaller PRs for easier review.

@ImpulseB23 ImpulseB23 merged commit 6eb9c0d into main Apr 19, 2026
13 checks passed
@ImpulseB23 ImpulseB23 deleted the feat/youtube-read-path branch April 19, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation go Go sidecar changes rust Rust/Tauri changes size/xl > 1000 lines, needs splitting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants